<template>
    <div>
      <div class="leader_show">
         
      </div>
      <div>
        <h3>小组信息显示</h3>
       
           <el-table
              :data="groupData"
              
              style="width: 100%">
              <el-table-column
                prop="groupId"
                label="组号"
                width="180">
              </el-table-column>
              <el-table-column
                prop="subjectName"
                label="课题名称"
                width="180">
              </el-table-column>
              <el-table-column
                prop="groupLeaderName"
                label="组长">
              </el-table-column>
              <el-table-column
                prop="count"
                label="人数"> 
              </el-table-column>
            </el-table>
          
      </div>
    </div>
</template>



<script>
import logapi from '@/api/login'
 import groupApi  from '@/api/subject/group'
import { getToken } from '../../../../utils/auth'
 
 


export default {
  data(){
    return{
      stuId:'',
      groupData:[]

    }

  },
  created(){
   this.getStudentInfo()

  },
  methods:{
    getStudentInfo(){
      logapi.getUserName(getToken())
      .then(response=>{
        this.stuId = response.data;
        this.getGroupInfo(this.stuId)
      })
    },
    getGroupInfo(stuId){
      groupApi.getStudentGroupInfo(stuId)
      .then(response =>{
        this.groupData= response.data;
        console.log(this.groupData)
      })

      
    }

  }
  
}
</script>


<style scoped>
  .el-table{
    width: 60% !important;
    height: 200px;
    margin: 30px auto;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  }
</style>
